package br.ufpe.cin.wormbox.protocolo;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;

import br.ufpe.cin.wormbox.core.FachadaUsuario.Status;
import br.ufpe.cin.wormbox.core.Transferencia;

public class TesteServer {
	
	public static void main(String[] args) throws IOException {
		RPFTServer server = new RPFTServer(5000);
		File f = new File("D:\\Daniel\\Installs\\NWN.rar");
		RPFTSocket sock;
		
		sock = server.aceitarConexao();
		System.out.println("Conectado");
		
		try {
			sock.enviar(f, new Transferencia("", 0, Status.SINCRONIZANDO));
		} catch (FileNotFoundException e) {
			System.err.println("O arquivo nao existe");
			System.exit(0);
		} catch (InterruptedException e) {
			System.err.println("hahahaha nunca vai entrar aqui");
			System.exit(0);
		}
	}
	
}
